<template>
  <div class>
    <!-- 搜索 -->
    <el-form ref="ruleForm" :model="searchForm" :rules="rules" label-width="100px">
      <el-row type="flex" :gutter="10" align="top">
        <el-col :span="10">
          <el-form-item label="关键字">
            <el-input v-model="searchForm.keyword" placeholder="根据文章标题搜索" style="width:180px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="状态">
            <el-select v-model="searchForm.state" placeholder="请选择" style="width:180px">
              <el-option label="启用" :value="1"></el-option>
              <el-option label="禁用" :value="0"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col>
          <el-button size="small" style="position: relative;top: -8px;" @click="clearClick">清除</el-button>
          <el-button
            size="small"
            style="position: relative;top: -8px;"
            type="primary"
            @click="searchClick"
          >搜索</el-button>
        </el-col>
        <el-row type="flex" justify="end">
          <el-col>
            <el-button
              type="success"
              size="small"
              style="position: relative;top: -8px;"
              icon="el-icon-edit"
              @click="$emit('onaddnewuser')"
            >新增技巧</el-button>
          </el-col>
        </el-row>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  name: '',
  components: {},
  props: {
    showpopups: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      searchForm: {
        keyword: null,
        page: 1,
        pagesize: 100,
        state: null
      },
      rules: {}
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    // 搜索
    searchClick() {
      this.$emit('searchClick', this.searchForm)
    },
    // 清除
    clearClick() {
      this.searchForm = {
        keyword: null,
        page: 1,
        pagesize: 100,
        state: null
      }
      this.$emit('clearClick')
    }
  }
}
</script>
<style lang="scss" scoped></style>
